package com.weixin.project.Common.Enum;

public enum RatingScore {
    CORRECT(2.0),
    LIKE(3.5),
    ERROR(4.0),
    FAVORITE(5.0);
    Double value;
    private RatingScore(Double value){
        this.value = value;
    }
    public Double getValue() {
        return value;
    }
    public static RatingScore codeOf(int code) {
        for (RatingScore ratingScore : values()) {
            if (ratingScore.getValue() == code) {
                return ratingScore;
            }
        }
        System.out.println("非法的code:" + code);
        return null;
    }
}
